package com.gxa.service.impl;

import com.gxa.mapper.LogMapper;
import com.gxa.pojo.Log;
import com.gxa.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(rollbackFor = Throwable.class)
public class LogServiceImpl implements LogService {

    @Autowired
    private LogMapper logMapper;

    /**
     * 添加日志
     * @param log
     * @return
     */
    @Override
    public Integer add(Log log) {
        return logMapper.insert(log);
    }

    /**
     * 查询所有日志
     * @return
     */
    @Override
    public List<Log> findAll() {
        return logMapper.findAll();
    }
}
